<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <p>join()将数组转换成字符串,对数组执行join会通过参数把字符串分隔,然后把它们连起来,返回的是一个字符串</p>
    <p>split()把字符串切割成数组,对字符串执行这个方法通过参数分隔符把他们断开,分割成字符串数组</p>
    <p></p>
</body>
<script>
    let arr = new Array(2)
    arr[0] = '小美'
    arr[1] = '小伟'
    console.log(arr.join());
    // 使用分隔符
    let arr1 = []
    arr1[0] = '你'
    arr1[1] = '好'
    arr1[2] = '呀'
    console.log(arr1.join('.'));
    // split()
    let str = '今天起的有点早'
    console.log(str.split(','));
    console.log(str.split(''));
</script>

</html>